package Notepad;

public class Page {

	private String title;
	private String text = "";
	
	Page(String title)
	{
		if(title == null)
		{
			System.out.println("Wrong title format! P;ease reset the app!");
			this.title  = "";
		}
		else 
		{
			this.title = title;
		}
	}
	void addText(final String text)
	{
		//this.text = this.text.concat(text);
		if(text != null)
			this.text = this.text + "\n" + text;
		else {
			System.out.println("Wrong text input!");
		}
		
		
	}
	
	void deleteText()
	{
		this.text = "";
	}
	String lookThtough()
	{
		return title  + "\n" + this.text;
	}
	@Override
	public boolean equals(Object obj) {
		if(obj instanceof Page)
		{
			return((Page) obj).title.equals(this.title);
		}
		else {
			return false;
		}
	}
	
}
